#pragma once
#ifndef ANALYSE_DETECTOR_H
#define ANALYSE_DETECTOR_H
#include <string> 
#include <iostream>

#include "TH1.h"
#include "TSystem.h"
#include "TStyle.h"
#include "TCanvas.h"
#include "TChain.h"
#include "TClonesArray.h"


#include "classes/DelphesClasses.h"

#include "ExRootTreeReader.h"
#include "ExRootResult.h"


#include "fastjet/PseudoJet.hh"
#include "fastjet/JetDefinition.hh"
#include "fastjet/ClusterSequence.hh"

class ExRootResult;
class ExRootTreeReader;

#include "src/Lib/libstructure.h"
#include "src/Lib/MessageFormat.h"
#include "src/Function/Fclass.h"
#include "src/Analyse/Abasic.h"
#include "src/Class/DrawClass.h"
#include "src/Class/debug.h"
#include "src/AnalyseClass/AnalyseClass.h"
#include "src/AnalyseClass/Object.h"


//bool GetFinalState(CDraw &para, TClonesArray *branchJet      ,TClonesArray *branchElectron ,TClonesArray *branchMuon     ,TClonesArray *branchPhoton   ,TClonesArray *branchMissingET,TClonesArray *branchParticle ,MyPlots* plots,
//		std::vector<Jet*> & Vjet,std::vector<Jet*>& Vbjet,std::vector<Jet*>& Vcjet,std::vector<Jet*>& Vqjet,std::vector<Jet*>& Vtaujet, std::vector<Jet*>& Vtagjet,std::vector<Jet*>& Vuntagjet,
//		std::vector<Electron*>& Velec,std::vector<Muon*>& Vmuon,std::vector<Jet*>& Vtau,std::vector<Photon*>& Vphoton,std::vector<MissingET*>& Vmet, AnalyseClass &analyse);
bool GetFinalState_detector(CDraw &para, AnalyseClass &analyse, AObject &object, MyPlots* plots);

void GetFinalState_detector_jet         (CDraw &para, AnalyseClass &analyse, AObject &object, TClonesArray *branchJet, MyPlots *plots, bool &Jjet, bool &Jtagjet);
void GetFinalState_detector_jet_collect (CDraw &para, AnalyseClass& analyse, TClonesArray *branchJet, MyPlots *plots,std::vector<Jet*> &jet, bool &Jjet);
void GetFinalState_detector_jet_classify(CDraw &para, AnalyseClass& analyse, std::vector<Jet*> &jet,std::vector<Jet*> &bjet, std::vector<Jet*> &cjet, std::vector<Jet*> &qjet, std::vector<Jet*>& taujet, std::vector<Jet*>& untagjet, MyPlots *plots, bool &Jbjet,bool &Jcjet,bool &Jtaujet,bool &Jqjet, bool &Juntagjet);
void GetFinalState_detector_pseudojet   (TClonesArray *branchJet, std::vector<fastjet::PseudoJet> &jet);

void GetFinalState_detector_lep         (CDraw &para, AnalyseClass &analyse, AObject &object, TClonesArray *branchElectron, TClonesArray *branchMuon, MyPlots *plots, bool &Jlep, bool &Jelec, bool &Jmuon);
void GetFinalState_detector_elec        (CDraw &para, TClonesArray *branchElectron, MyPlots *plots,std::vector<Electron*> &elec, bool &Jelec);
void GetFinalState_detector_muon        (CDraw &para, TClonesArray *branchMuon, MyPlots *plots,std::vector<Muon*> &muon, bool &Jmuon);
void GetFinalState_detector_cut         (CDraw &para, MyPlots *plots,std::vector<TLorentzVector> &lep, bool &Jlep);

void GetFinalState_detector_met         (CDraw &para, AnalyseClass &analyse, AObject &object, TClonesArray *branchMissingET, MyPlots *plots,std::vector<MissingET*> &met, bool &Jmet);
void GetFinalState_detector_photon      (CDraw &para, AnalyseClass &analyse, AObject &object, TClonesArray *branchPhoton, MyPlots *plots,std::vector<Photon*> &photon, bool &Jphoton);

bool GetFinalState_detector_make_signal_jet (CDraw &para, AObject &object);
bool GetFinalState_detector_make_signal_lep(CDraw &para, AObject &object);
#endif
